﻿// Copyright (c)  YISH. All rights reserved.
// Licensed under the MIT License, See License.txt in the project root for license information.

namespace NSQL.Expressions
{
    public interface IConstantStringExpression : IStringExpression, IConstantExpression<string>
    {
    }
    public class StringExpression : ConstantExpression, IConstantStringExpression
    {
        public string Value { get; set; }

        public override object ValueOf() => Value;

        private StringExpression(string value = null) => Value = value;

        public static implicit operator StringExpression(string val) => new StringExpression(val);
        public static implicit operator StringExpression(char val) => new StringExpression(val.ToString());
        protected override IExpression DeepCopy()
        {
            return new StringExpression(Value)
            {
                Tag = Tag
            };
        }
    }
}